/**
 * 
 */
package trungsi.gea.photos.util;

import com.google.appengine.api.images.ImagesService;
import com.google.appengine.api.images.ImagesServiceFactory;
import com.google.appengine.api.images.Transform;



/**
 * @author trungsi
 *
 */
public class PhotoUtils {

	public static byte[] resize(byte[] photoByteArray, int size) {
		ImagesService imageService = ImagesServiceFactory.getImagesService();
		Transform resize = ImagesServiceFactory.makeResize(size, size);
		
		return imageService.applyTransform(resize, 
				ImagesServiceFactory.makeImage(photoByteArray)).getImageData();
	}

}
